package com.tionsy.springbootshiro.utils;

import com.tionsy.springbootshiro.entity.UserEntity;
import org.apache.shiro.SecurityUtils;

/**
 * @author tiany
 * @date 2018/12/24 16:49
 */
public class ShiroUtils {

    public static UserEntity getUser() {
        return (UserEntity) SecurityUtils.getSubject().getPrincipal();
    }

//    public static void clearCachedAuthorizationInfo() {
//        RealmSecurityManager rsm = (RealmSecurityManager) SecurityUtils.getSecurityManager();
//        CustomShiroRealm realm = (CustomShiroRealm) rsm.getRealms().iterator().next();
//        realm.clearCachedAuthorizationInfo();
//    }

}

